<?php
if (Common::post('font')) {
    list($status, $error) = FontHelper::handle_font_upload($_FILES['upload']);
    if ($status) {
        return Common::redirect(Common::httpUri('/'));
    }
}
?>
<?php if ($error) { ?>
    <div class="alert alert-danger" role="alert"><?php echo $this->error; ?></div>
<?php } ?>
<form id="search_form" method="post" enctype="multipart/form-data" action="" class="form-horizontal" role="form">
    <div class="form-group f-line f-line-even">
        <label class="col-sm-2 control-label" for="search_host">
            TrueType Font File(.ttf)</label>

        <div class="col-sm-10 f-body">
            <input type="file" name="upload" class="f-text form-control search-host"
                   value="">
        </div>
    </div>
    <div class="form-group f-submit-line">
        <div class="col-sm-offset-2 col-sm-10 f-submit">
            <input type="submit" class="btn btn-primary" value="Submit">
            <input type="hidden" name="font" value="1" />
        </div>
    </div>
</form>